package com.simple.study.controller;

import com.simple.study.base.controller.BaseController;
import com.simple.study.entity.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Author SimpleTree
 **/
@RestController
@RequestMapping("/test")
public class TestController extends BaseController {

    /**
     * 这里权限在UserDetailsServiceImpl中固定为admin，user
     * @return
     */
    @PreAuthorize("hasAnyAuthority('user','admin')")
    @GetMapping
    public Result test(){
        return success("这是个测试");
    }

}
